<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminOperationLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_operation_logs', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->integer('user_id')->nullable()->comment('用户ID');
            $table->string('path', 200)->nullable()->comment('路径');
            $table->string('method', 200)->nullable()->comment('方法');
            $table->string('ip', 50)->default('1')->comment('IP');
            $table->text('input')->nullable()->comment('参数');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_operation_logs');
    }
}
